<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>课工场论坛列表</title>
		<link href="css/bbs.css" rel="stylesheet">
		<script>
			
			function fa(){
				let dd= document.querySelector("#fatie");
				
				let cs=document.defaultView.getComputedStyle(fatie,null).display
				dd.style.display="block";
				
			}
			function fa2(){
				let dd= document.querySelector("#fatie");
				let aa=document.querySelector("#biaoti").value;
				let xz=document.querySelector("#se1").value;
				let	f=document.querySelector("#postList");
				let z=document.querySelector("#l1");
							
				let tie=z.cloneNode(true);
				let biao= tie.firstElementChild.nextElementSibling;
				let ban=tie.lastElementChild.firstElementChild;
				let shi=tie.lastElementChild.lastElementChild;
			let im=tie.firstElementChild.firstElementChild;
			// im.src="images/tou0"+Math.floor(Math.random()*5)+1+".jpg";
				biao.innerHTML=aa;
				ban.innerHTML="版块:"+xz;
				shi.innerHTML="发表时间:"+new Date().toLocaleString();
				f.appendChild(tie);
				// alert(biao+","+ban+","+shi);
				
				dd.style.display="none";
			}
		</script>
	</head>
	<body>
		<div class="bbs">
			<header><span onclick="fa()" >我要发帖</span></header>
			<section>
				<ul id="postList">
					<li id="l1" >
						<div><img src="images/tou02.jpg"></div>
						<h1>ggggg</h1>
						<p><span>版块：新手报到</span><span>发表时间：2019-11-18 17:28</span></p>
					</li>
					<li>
						<div>
							<img src="images/tou01.jpg"></div>
						<h1>ddddd</h1>
						<p><span>版块：新课来了</span><span>发表时间：2019-11-18 17:27</span></p>
					</li>
				</ul>
			</section>

			<div class="post" id="fatie" >
				<input class="title" placeholder="请输入标题（1-50个字符）" id="biaoti" >
				所属版块：<select id="se1">
					<option>请选择版块</option>
					<option>电子书籍</option>
					<option>新课来了</option>
					<option>新手报到</option>
					<option>职业规划</option>
				</select>
				<textarea class="content"></textarea>
				<input class="btn" value="发布" onclick="fa2()" >
			</div>
		</div>
	</body>
</html>
